package persistence;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the Firm database table.
 * 
 */
@Embeddable
public class FirmPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private int idFirm;
	private int crd;

    public FirmPK() {
    }

	public int getIdFirm() {
		return this.idFirm;
	}
	public void setIdFirm(int idFirm) {
		this.idFirm = idFirm;
	}

	public int getCrd() {
		return this.crd;
	}
	public void setCrd(int crd) {
		this.crd = crd;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof FirmPK)) {
			return false;
		}
		FirmPK castOther = (FirmPK)other;
		return 
			(this.idFirm == castOther.idFirm)
			&& (this.crd == castOther.crd);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idFirm;
		hash = hash * prime + this.crd;
		
		return hash;
    }
}